<template>
  <div class="grandson2">
    <h2>我是Grandson2组件</h2>
    <h3>我哥给我的玩具：{{ wanju }}</h3>
  </div>
</template>

<script>
  export default {
    name:'Grandson2',
    data() {
      return {
        wanju:''
      }
    },
    methods: {
      getToy(value){
        console.log('我收到了玩具：',value)
        this.wanju = value
      }
    },
    mounted() {
      this.$bus.$on('send-toy',this.getToy)
    },
  }
</script>

<style scoped>
  .grandson2 {
    margin-top: 10px;
    background-color: orange;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 10px;
  }
</style>